package jonggyuni.basic;

public class J06_Patterns {

	public static void main(String[] args) {
		// 반복문을 이용해서 다양한 패턴 출력하기
		int i;
		int j=1;
		
		i = 1;
		System.out.println("PATTERN 1");
		while(j<6){		// 행 row
			while(i<=j){	// 열 col
				System.out.print("[]");
				++i;
			}
			j++;
			i=1;
			System.out.println("");
		}
		System.out.println("\n");
		i = 1;
		j = 6;
		System.out.println("PATTERN 2");
		while(j>=1){		// 행 row
			while(i<=j){	// 열 col
				System.out.print(i + " ");
				i++;
			}
			j--;
			i=1;
			System.out.println("");
		}
		

		i=1;
		while(i<=6){
			if(i!=6)
				System.out.print(" ");
			else
				System.out.println(i);
			i++;
		}
		////////////////////////////////
		System.out.println("PATTERN 3");
		i=6;
		j=1;
		while(j<=6){
			while(i>=1){
				if(i>j)
					System.out.print(" ");
				else
					System.out.print(i);
				--i;
			}
			System.out.println("");
			i=6;
			++j;
		}
		System.out.println("PATTERN 4");
		i=1;
		j=6;
		while(j>=1){
			while(i<=6){
				if(i>j)
					System.out.print(" ");
				else
					System.out.print(i);
				++i;
			}
			System.out.println("");
			i=1;
			--j;
		}
		System.out.println("------");
		for(j=6;j>=1;j--){
			for(i=1;i<=j;i++){
				System.out.print(i);
			}
			System.out.println("");
			}
		System.out.println("");

		for(int m=1;m<=6;m++){
			for(int k=1;k<=6;++k){
				if(k>=m)
					System.out.print((k-(m-1)) + " ");
				else
					System.out.print("  ");
			}
			System.out.println("");
		}
		
		
		
		}
	

		
}


